package com.company.controller;

import com.company.service.FileStorageService;
import com.company.utils.MessageResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/images")
public class ImageUploadController {
    @PostMapping
    public MessageResponse<String> upload(@RequestParam("file")MultipartFile multipartFile) {
        return FileStorageService.save(multipartFile);
    }
}
